const inputUserName2 = document.querySelector("#inputUserName2")
const inputPwd2 = document.querySelector("#inputPwd2")
var btnregister = document.querySelector("#btnregister")

btnregister.addEventListener('click',function(){
	const name = inputUserName2.value,
		  pwd = inputPwd2.value
		 
	utils.fetch('api/user/register.php',{name,pwd}).then(resp => {
		if(resp.code ===200){
			alert(resp.body.msg)
		}else{
			alert(resp.body.msg)
		}
	})
})

$('#myModal2').on('hidden.bs.modal', function (e) {
  // 当模态框被影藏之后的事件
  inputUserName2.value = inputPwd2.value = ''
})
